/*
 * TMap Designer - A Thematic Map design software
 * Copyright (C) 2006 World Health Organization
 * http://www.who.int
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
package who.tmap.bo.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import who.tmap.bo.AttrDef;
import who.tmap.bo.Attrs;

/**
 * Stores attributes (header and rows)
 * @author stl
 *
 */
public class AttrsImpl  extends BaseBizObjectImpl implements Attrs {

    protected List<AttrDef> header =new ArrayList<AttrDef>();
    @SuppressWarnings("unchecked")
	protected List<List> rows =new ArrayList<List>();
    protected int polygonIdIdx;
    protected int dataIdx;
    protected int xColumnIdx;
    protected int yColumnIdx;
    protected int descriptorColumnIdx;
    protected int sizeColumnIdx;
    protected Map<String, String> dsProperties;

    public AttrsImpl() {
    	super();
    }
    
    /**
     * @return Returns the header.
     */
    public List<AttrDef> getHeader() {
        return header;
    }
    
    /**
     * @param header The header to set.
     */
    public void setHeader(List<AttrDef> header) {
        this.header = (ArrayList<AttrDef>)header;
    }
    
    /**
     * @return Returns the rows.
     */
    @SuppressWarnings("unchecked")
	public List<List> getRows() {
        return rows;
    }
    
    /**
     * @param rows The rows to set.
     */
    @SuppressWarnings("unchecked")
	public void setRows(List<List> rows) {
        this.rows = rows;
    }    
    
    public int getDataIdx() {
		return dataIdx;
	}

	public void setDataIdx(int dataIdx) {
		this.dataIdx = dataIdx;
	}

	public int getJoinIdIdx() {
		return polygonIdIdx;
	}

	public void setJoinIdIdx(int polygonIdIdx) {
		this.polygonIdIdx = polygonIdIdx;
	}	

	public int getXColumnIdx() {
		return xColumnIdx;
	}

	public void setXColumnIdx(int columnIdx) {
		xColumnIdx = columnIdx;
	}

	public int getYColumnIdx() {
		return yColumnIdx;
	}

	public void setYColumnIdx(int columnIdx) {
		yColumnIdx = columnIdx;
	}	

	public int getDescriptorColumnIdx() {
		return descriptorColumnIdx;
	}

	public void setDescriptorColumnIdx(int descriptorColumnIdx) {
		this.descriptorColumnIdx = descriptorColumnIdx;
	}	
	
	public int getSizeColumnIdx() {
		return sizeColumnIdx;
	}

	public void setSizeColumnIdx(int sizeColumnIdx) {
		this.sizeColumnIdx = sizeColumnIdx;
	}	

	public Map<String, String> getDsProperties() {
		return dsProperties;
	}

	public void setDsProperties(Map<String, String> dsProperties) {
		this.dsProperties = dsProperties;
	}

	public String toString() {
        return new StringBuffer( "header=" )
        			.append( header )
        			.append( "\nrows=" ).append( rows )
        			.toString();
    }
}
